package org.apache.shiro.samples;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @author Webster
 * <p>
 * Description:Simple Service with methods protected with annotations.
 * </p>
 * @date 2021/3/10
 * @see org.apache.shiro.samples
 */
@Component
public class SimpleService {

	private static Logger log = LoggerFactory.getLogger(SimpleService.class);

	@RequiresPermissions("write")
	public void writeRestrictedCall() {
		log.info("executing method that requires the 'write' permission");
	}

	@RequiresPermissions("read")
	public void readRestrictedCall() {
		log.info("executing method that requires the 'read' permission");
	}
}
